<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		
		<script>
			//1/创建被匹配的信息内容
			var str = "today is Monday";
			//创建正则表达式regular
			var reg = /Mon/;
			//
			var result = str.match(reg);
			console.log(result);
			
			// +:1次或多次,后面带g，全局匹配
			var str1 = "asdadadj1231";
			var reg1 = /[0-8]+/;
			console.log(str1.match(reg1));
			//*:0次或多次
			var str2 = "asdadadj1231";
			var reg2 = /[0-8]+/;
			console.log(str2.match(reg2));
			//?前面单元出现0次或1次
			var reg3 = /wo?rld/;
			var str3 = "wrld";
			var str4 = "world";
			var str5 = "woorld";
			
			console.log(str3.match(reg3));
			console.log(str4.match(reg3));
			console.log(str5.match(reg3));
		</script>
	</body>
</html>
